package cn.edu.scau.cmi.linkaibo.client;

import java.util.Scanner; 

import cn.edu.scau.cmi.linkaibo.abstractFactory.*; 
import cn.edu.scau.cmi.linkaibo.abstractFactory.domain.*; 
import cn.edu.scau.cmi.linkaibo.abstractFactory.domainAbstractClass.*; 
import cn.edu.scau.cmi.linkaibo.abstractFactory.domainInterface.*; 
import cn.edu.scau.cmi.linkaibo.abstractFactory.factory.*; 

public class AbstractFactoryClient { 

 public static void main(String[] args) {  
	 
	 System.out.println("Please select brand: aonong, tianbang or wens"); 
	 Scanner scanner = new Scanner(System.in); 
	 String brandKind = scanner.next(); 
	 brandKind=brandKind.toLowerCase(); 
	 AbstractFactory factory=null; 
	 switch(brandKind){ 
		 case "aonong": factory=new AonongFactory();break; 
		 case "tiangbang": factory=new TianbangFactory();break; 
		 case "wens": factory=new WensFactory();break; 
		 default:System.out.println("sorry, it is not correct"); 

     } 

  System.out.println("Please select meat: beef, chicken or pork"); 
  String meatType = scanner.next(); 
  meatType=meatType.toLowerCase(); 
  Meat meat=null; 
  switch(meatType) { 
	  case "beef": meat=factory.createBeef();break; 
	  case "chicken": meat=factory.createChicken();break; 
	  case "pork": meat=factory.createPork();break; 
	  default:System.out.println("sorry, it is not correct");  
  } 
  if(meat!=null) { 
      meat.play(); 
  } 
 } 

}